package bean;

import java.util.Objects;

public class User {
    public static final int MAX_USER_NAME_LENGTH = 10;
    public static final int MAX_PASSWORD_LENGTH = 10;
    private int userId;
    private String userName;
    private String password;

    public User() {
    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }
    
    public static boolean verifyUserName(String userName) {
        return Objects.nonNull(userName) && userName.length() > 0
            && userName.length() <= User.MAX_USER_NAME_LENGTH ? true : false;
    }
    
    public static boolean verifyPassword(String password) {
        return Objects.nonNull(password) && password.length() > 0
            && password.length() <= User.MAX_PASSWORD_LENGTH ? true : false;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
